home *** CD-ROM | disk | FTP | other *** search
- .SH
- utorial
- .LP
- his is a short simple tutorial to (hopefully) show you how to use the
- LV toolkit commands and also how to interface to the toolkit when
- riting your own programs. A sample image is included in the
- istribution and this will be used to demonstrate a few of the
- oolkit's facilities.
- .LP
- First of all, decode the sample image, which has been encoded to permit
- ts transfer via email.
- .DS L
- n the images directory type "make"
- .DE
- ou should now have a file named "sample_image" in the directory. This
- mage is a picture of University Walk in Bristol University, UK showing
- art of The Queen's Building (Engineering Faculty and home of the
- omputer Science Dept.) in the background.
- .LP
- he screen display facilities of the toolkit only work in
- .I Sunview
- t present, so
- .DS L
- ype "suntools"
- .DE
- o enter
- .I Sunview
- f you are not already in the windowing enviroment.
- .LP
- o display the image on the screen of your workstation
- .DS L
- ype "dsp sample_image"
- .DE
- nd the image will be displayed on your screen. THe program dsp checks
- o see whether you are running the toolkit on a colour or on a black &
- hite Sun Workstation and displays using 256 Greylevels or a dithering
- echnique as appropriate. To exit the display program it will have to
- e killed by pressing the right mouse button on the top black frame bar
- f the image and selecting the "Quit" menu entry.
- .LP
- o show a histogram of the greylevels present in an image use the "hist"
- ommand. For example,
- .DS L
- ype "hist sample_image"
- .DE
- o show the histogram plot of the sample image. Some additional data is
- ritten to the invoking window (via the standard error stream).
- .LP
- o convolve the sample image with a linear filter, say a Laplacian
- ilter, and then to display the results
- .DS L
- ype "convolve -flap1 -e sample_image | dsp"
- .DE
- he "-f" option states which filter to use and the "-e" option tells
- he convolve program to use enhanced scaling on the output. (Basically
- his involves another pass over the image to stretch the Greylevel
- ange in the output to the maximum available).
- .LP
- his command line also demonstrates one of the main design features of
- he
- .I ALV
- oolkit - communication between processes via Unix pipes. The
- "|" symbol above connects the ouput of the "convolve" command (the
- onvolved image) with the input of the "dsp" command with the net
- esult of dislaying the convolved image on the screen. Most of the
- oolkit's commands can be joined together like this and there is no
- (theoretical) limit to the number of commands that can be linked in this
- ay. For example, typing
- .DS L
- "convolve -fxdiff1 -e sample_image | rasrange -l64 -h192 | rasscale -s0.5 | dsp"
- .DE
- auses the sample image to be convolved with a 5*5 X-differentiating
- inear filter with enhanced scaling, then ranged so that what was
- reylevel 64 becomes greylevel 0 and what was greylevel 192 becomes
- reylevel 255, scaled to half size and then
- isplayed on the screen. Far more complex piplines than this can be
- onstructed! For further information about using the commands consult the
- .I ALV
- ommand manual pages.
- .LP
- f you wish to construct your own tools, the file
- .I src/generic.c
- ay be usefully used as a template. This contains all the code necessary
- or accessing the
- .I ~/.alv_profile ,
- or parsing the command-line arguments and for reading the raster into memory.
- o compile this requires the files
- .I src/defs.h
- nd
- .I src/support.h
- ogether with the
- .I pixrect
- ibrary
- .I lpixrect .
- f you do write any other filters which you find useful, please
- onsider mailing them to me so that I can redistribute them to other
- sers of the toolkit.
-